package com.odin.rmsservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author ICE
 */
@Data
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 3117020908304645014L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度为6-20")
    private String password;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式错误")
    @NotBlank(message = "登录账号不能为空")
    private String email;

    /**
     * 权限
     */
    private Integer roleId                                      =1;

    /**
     * 性别
     */
    private Integer sex                                         =1;

    /**
     * 头像地址
     */
    private String headUrl;

    /**
     * 备注
     */
    private String remark                                       = "这家伙很懒，什么都没留下";

}
